package bb.lanxing.devices.sync;

import android.content.Context;
import android.content.Intent;
import bb.lanxing.service.SyncTaskService;

public class DeviceSyncHelper {
    public static void syncWorkoutWithId(Context context, long workoutId) {
        Intent intent = new Intent(context, SyncTaskService.class);
        intent.putExtra(SyncTaskService.EXTRA_TASK_ID, SyncTaskService.TASK_SYNC_WORKOUT);
        intent.putExtra("workout_id", 1);
        if (intent.resolveActivity(context.getPackageManager()) != null) {
            intent.putExtra("workout_id", workoutId);
            try {
                context.startService(intent);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
